Optimal. Leaf size=122 \[ -\frac{(4 B-3 C) \sin ^3(c+d x)}{3 a d}+\frac{(4 B-3 C) \sin (c+d x)}{a d}-\frac{3 (B-C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac{(B-C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}-\frac{3 x (B-C)}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.241275, antiderivative size = 122, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.15, Rules used = {4072, 4020, 3787, 2633, 2635, 8} \[ -\frac{(4 B-3 C) \sin ^3(c+d x)}{3 a d}+\frac{(4 B-3 C) \sin (c+d x)}{a d}-\frac{3 (B-C) \sin (c+d x) \cos (c+d x)}{2 a d}-\frac{(B-C) \sin (c+d x) \cos ^2(c+d x)}{d (a \sec (c+d x)+a)}-\frac{3 x (B-C)}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4072
Rule 4020
Rule 3787
Rule 2633
Rule 2635
Rule 8
Rubi steps
\begin{align*} \int \frac{\cos ^4(c+d x) \left (B \sec (c+d x)+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=\int \frac{\cos ^3(c+d x) (B+C \sec (c+d x))}{a+a \sec (c+d x)} \, dx\\ &=-\frac{(B-C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac{\int \cos ^3(c+d x) (a (4 B-3 C)-3 a (B-C) \sec (c+d x)) \, dx}{a^2}\\ &=-\frac{(B-C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}+\frac{(4 B-3 C) \int \cos ^3(c+d x) \, dx}{a}-\frac{(3 (B-C)) \int \cos ^2(c+d x) \, dx}{a}\\ &=-\frac{3 (B-C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac{(B-C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac{(3 (B-C)) \int 1 \, dx}{2 a}-\frac{(4 B-3 C) \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{a d}\\ &=-\frac{3 (B-C) x}{2 a}+\frac{(4 B-3 C) \sin (c+d x)}{a d}-\frac{3 (B-C) \cos (c+d x) \sin (c+d x)}{2 a d}-\frac{(B-C) \cos ^2(c+d x) \sin (c+d x)}{d (a+a \sec (c+d x))}-\frac{(4 B-3 C) \sin ^3(c+d x)}{3 a d}\\ \end{align*}
Mathematica [B] time = 0.603744, size = 249, normalized size = 2.04 \[ \frac{\sec \left (\frac{c}{2}\right ) \cos \left (\frac{1}{2} (c+d x)\right ) \left (-36 d x (B-C) \cos \left (c+\frac{d x}{2}\right )+21 B \sin \left (c+\frac{d x}{2}\right )+18 B \sin \left (c+\frac{3 d x}{2}\right )+18 B \sin \left (2 c+\frac{3 d x}{2}\right )-2 B \sin \left (2 c+\frac{5 d x}{2}\right )-2 B \sin \left (3 c+\frac{5 d x}{2}\right )+B \sin \left (3 c+\frac{7 d x}{2}\right )+B \sin \left (4 c+\frac{7 d x}{2}\right )-36 d x (B-C) \cos \left (\frac{d x}{2}\right )+69 B \sin \left (\frac{d x}{2}\right )-12 C \sin \left (c+\frac{d x}{2}\right )-9 C \sin \left (c+\frac{3 d x}{2}\right )-9 C \sin \left (2 c+\frac{3 d x}{2}\right )+3 C \sin \left (2 c+\frac{5 d x}{2}\right )+3 C \sin \left (3 c+\frac{5 d x}{2}\right )-60 C \sin \left (\frac{d x}{2}\right )\right )}{24 a d (\cos (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.096, size = 281, normalized size = 2.3 \begin{align*}{\frac{B}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-{\frac{C}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-3\,{\frac{C \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{5}}{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}+5\,{\frac{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{5}B}{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}-4\,{\frac{C \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{3}}{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}+{\frac{16\,B}{3\,ad} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{3} \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-3}}-{\frac{C}{ad}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-3}}+3\,{\frac{B\tan \left ( 1/2\,dx+c/2 \right ) }{ad \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}-3\,{\frac{B\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{ad}}+3\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) C}{ad}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.43261, size = 419, normalized size = 3.43 \begin{align*} \frac{B{\left (\frac{\frac{9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{16 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{15 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a + \frac{3 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac{3 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac{a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac{9 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac{3 \, \sin \left (d x + c\right )}{a{\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - 3 \, C{\left (\frac{\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a + \frac{2 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac{a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} - \frac{3 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac{\sin \left (d x + c\right )}{a{\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.493189, size = 243, normalized size = 1.99 \begin{align*} -\frac{9 \,{\left (B - C\right )} d x \cos \left (d x + c\right ) + 9 \,{\left (B - C\right )} d x -{\left (2 \, B \cos \left (d x + c\right )^{3} -{\left (B - 3 \, C\right )} \cos \left (d x + c\right )^{2} +{\left (7 \, B - 3 \, C\right )} \cos \left (d x + c\right ) + 16 \, B - 12 \, C\right )} \sin \left (d x + c\right )}{6 \,{\left (a d \cos \left (d x + c\right ) + a d\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15318, size = 204, normalized size = 1.67 \begin{align*} -\frac{\frac{9 \,{\left (d x + c\right )}{\left (B - C\right )}}{a} - \frac{6 \,{\left (B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{a} - \frac{2 \,{\left (15 \, B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 9 \, C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 16 \, B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 12 \, C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 9 \, B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 3 \, C \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3} a}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]